﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Data;
using System.Data.SqlClient;
namespace ECCSystem.BizRule
{ 
    class ClsRule
    {
		DataAccess.ClsRule objDAMC = new ECCSystem.DataAccess.ClsRule();
		public ClsRule()
        { }
        //Get all MailCategory records list

		public string AddRule(string strCaption, string strContent, int intLimited,
							DateTime dtStartTime, DateTime dtEndTime, string strUserName,
							string strUserID, int intUserID, string[] strKeyID)
        {
			SqlTransaction objTran = ClsCommon.gObjConn.BeginTransaction();
			return objDAMC.AddRule(strCaption, strContent, intLimited, dtStartTime, dtEndTime, strUserName, strUserID, intUserID, strKeyID,objTran);

        }

		public object GetList()
		{
			return objDAMC.GetRule();
		}

		public object GetList(string strWhere)
		{
			return objDAMC.GetRule(strWhere);
		}

		public object GetEmailTempletList()
		{
			return objDAMC.GetEmailTempletList();
		}

		public void DeleteRule(string strID)
		{
			objDAMC.DeleteRule(strID);
		}

		public string UpdateRule(string strID, string strCaption, string strContent, int intLimited,int intUserID,
							DateTime dtStartTime, DateTime dtEndTime, string strUserName, string strUserID, string[] strKeyID,string[] strFlg)
		{
			SqlTransaction objTran = ClsCommon.gObjConn.BeginTransaction();
			return objDAMC.UpdateRule(strID, strCaption, strContent, intLimited,intUserID, dtStartTime, dtEndTime, strUserName, strUserID,strKeyID,strFlg,objTran);
		}
    }
}
